package com.atguigu.service;

import com.atguigu.base.BaseService;
import com.atguigu.entity.UserFollow;
import com.atguigu.vo.UserFollowVo;
import com.github.pagehelper.PageInfo;

/**
 * @PACKAGE_NAME: com.atguigu.service
 * @CLASSNAME: UserFollowService
 * @AUTHOR: zhangsan
 * @DATE: 2024/4/29 15:54
 * @SINCE 17.0.7
 * @DESCRIPTION: UserFollowService
 */
public interface UserFollowService extends BaseService<UserFollow> {
    /**
     * 根据用户id,分页查询该用户的关注列表
     * @param pageNum
     * @param pageSize
     * @param id
     * @return
     */
    PageInfo<UserFollowVo> findListPage(Integer pageNum, Integer pageSize, Long userId);

    /**
     * 关注房源
     * @param userId
     * @param houseId
     */
    UserFollow follow(Long userId, Long houseId);

    /**
     * 用户是否关注房源
     * @param userId
     * @param houseId
     * @return
     */
    Boolean isFollowed(Long userId, Long houseId);

    /**
     * 取消关注
     * @param id
     * @return
     */
    void cancelFollow(Long id);

    void cancelFollow(Long userId, Long houseId);
}
